package com.qezhhnjy.firstuser;

import com.qezhhnjy.demo.starter.config.DemoProperties;
import com.qezhhnjy.demo.starter.service.ConditionService;
import com.qezhhnjy.demo.starter.service.DemoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Import;

import javax.annotation.Resource;

/**
 * @author zhaoyangfu
 * @date 2021/5/15-12:36
 */
@SpringBootApplication
@Import(ConditionService.class)
@Slf4j
public class UserApplication implements CommandLineRunner {

    @Resource
    private DemoProperties demoProperties;

    @Resource
    private DemoService demoService;

    @Resource
    private DemoService demo;

    public static void main(String[] args) {
        SpringApplication.run(UserApplication.class, args);
    }

    @Override
    public void run(String... args) throws Exception {
        log.warn("say what {} to who {}",demoProperties.getSayWhat(),demoProperties.getToWho());
        log.warn(demoService.say());
        log.warn(demo.say());
    }
}
